package com.tyqx.hashchainbackend.service.impl;

import com.tyqx.hashchainbackend.service.UsersService;
import com.tyqx.hashchainbean.module.Users;
import com.tyqx.hashchaindao.mapper.UsersMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service("usersService")
public class UsersServiceImpl implements UsersService {

    @Resource
    private UsersMapper usersMapper;

    public Integer saveUserInfo(Users users, String sessionKey, String skey)throws Exception {
        Date currentDate = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date createTime=sdf.parse(sdf.format(currentDate));
        return null;
    }


    public List<String> getUidBySkey(String skey) {
        return usersMapper.getIdBySkey(skey);
    }


    public List<String> getIdByCompName(String compName) {
        return usersMapper.getIdByCompName(compName);
    }


    public List<String> getCompNameById(String uid) {
        return usersMapper.getIdByCompName(uid);
    }


    public Integer updateCompName(String uid, String name, String phone, String businessScope) {
        return usersMapper.updateCompName(uid, name, phone, businessScope);
    }
}
